﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true" CodeFile="Category.aspx.cs" Inherits="Category" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        </style>
       
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" DataSourceID="SqlDataSource1" KeyFieldName="Cat_ID" Width="100%" 
        CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" 
        onrowvalidating="ASPxGridView1_RowValidating" 
        onstartrowediting="ASPxGridView1_StartRowEditing" 
        oncommandbuttoninitialize="ASPxGridView1_CommandButtonInitialize">
        
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0">
                <EditButton Visible="True">
                </EditButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>

                </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="0">
                <NewButton Visible="True">
                </NewButton>
                </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="0" Name="delete">
                <DeleteButton Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
              <dx:GridViewDataTextColumn FieldName="Cat_ID" VisibleIndex="1" Caption="Category ID" 
                >
                  <EditCellStyle BackColor="#FFF7DD">
                  </EditCellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Cat_Name" VisibleIndex="2" 
                Caption="Category Name">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="3" Width="5px">
            </dx:GridViewDataTextColumn>
           <dx:GridViewDataComboBoxColumn Caption="Status" FieldName="Status" 
                 VisibleIndex="5" Width="100px">
                <PropertiesComboBox ValueType="System.String" EnableSynchronization="False" IncrementalFilteringMode="StartsWith" >
                    <Items>
                        <dx:ListEditItem Text="Show" Value="Show"  />
                        <dx:ListEditItem Text="Hide" Value="Hide" />
                    </Items>
                    <ItemStyle Cursor="auto" />
                </PropertiesComboBox>
                <Settings AllowAutoFilterTextInputTimer="True" FilterMode="DisplayText" />
            </dx:GridViewDataComboBoxColumn>
                
            
            <dx:GridViewDataTextColumn ShowInCustomizationForm="True"  
                VisibleIndex="7" FieldName="date" UnboundExpression="System.DateTime.Now" 
                UnboundType="DateTime">
               
            </dx:GridViewDataTextColumn>
                
            
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        SelectCommand="SELECT [Cat_ID], [Cat_Name], [Description], [Status] FROM [Tbl_Category]" 
        
        InsertCommand="INSERT INTO [Tbl_Category] ([Cat_ID], [Cat_Name], [Description], [Status]) VALUES (@Cat_ID, @Cat_Name, @Description, @Status)" 
        
        UpdateCommand="UPDATE [Tbl_Category] SET [Cat_Name] = @Cat_Name, [Description] = @Description, [Status] = @Status WHERE [Cat_ID] = @Cat_ID" 
        DeleteCommand="DELETE FROM [Tbl_Category] WHERE [Cat_ID] = @Cat_ID">
        <DeleteParameters>
            <asp:Parameter Name="Cat_ID" Type="String" />
           
        </DeleteParameters>
        <InsertParameters>
        <asp:Parameter Name="date" Type="DateTime" />
            <asp:Parameter Name="Cat_ID" Type="String"  />
            <asp:Parameter Name="Cat_Name" Type="String"  />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Status" Type="String" />
        </InsertParameters>

        <UpdateParameters>
            <asp:Parameter Name="Cat_Name" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="Cat_ID" Type="String" />
        </UpdateParameters>

        </asp:SqlDataSource>

   

    <asp:Label ID="Label2" runat="server" Text="Label" Visible="False"></asp:Label>

   

    </asp:Content>

